package com.qd.core.config;

import com.qd.core.service.InitSyncService;
import com.qd.pay.thread.OrderNotifyErrorThread;
import com.qd.pay.thread.OrderNotifyThread;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjk
 * @create 2020-10-15 10:10
 * @since 1.0.0
 */
@Component
@Order(1)
@Slf4j
@RequiredArgsConstructor
public class ApplicationRunnerImpl implements ApplicationRunner {
    private final InitSyncService initSyncService;
    private final OrderNotifyThread orderNotifyThread;
    private final OrderNotifyErrorThread orderNotifyErrorThread;

    @Override
    public void run(ApplicationArguments args) {
//        initSyncService.initDictData();
        orderNotifyThread.start();
        orderNotifyErrorThread.start();
        initSyncService.initMsgProcess();
//        initSyncService.initDelayOrderQueueManager();
        initSyncService.initUserAgent();
        initSyncService.init();
    }
}